POV-Ray : Newsgroups : povray.beta-test : 2.2.1.2 Comments (block comments). : Re: 2.2.1.2 Comments (block comments). Server Time
29 Jul 2024 06:26:10 EDT (-0400)
  Re: 2.2.1.2 Comments (block comments).  
From: Warp
Date: 26 Mar 2006 01:46:55
Message: <442638df@news.povray.org>
Lance Birch <-> wrote:
> However, it's probably a lot of work to implement for very little gain.

  I don't understand why. Parsing them is quite trivial, so coloring them
correctly should be too. Just increase a counter when /* is encountered
and decrease it when */ is encountered, When the counter gets back to 0,
that's the end of the comment.

  Of course there may be ambiguous cases like this:

/*
#debug "Comments end with the */ symbol\n"
*/

  However, I don't think it would be so difficult to make the syntax-coloring
algorithm to interpret that like the parser does (and in fact, if it does so,
it helps the user to immediately spot a potential problem with comments
if there exists one, as might be the case here).

  In fact, I just checked and the above causes a syntax error in POV-Ray
because it doesn't "parse" strings inside comments. Thus coloring that
becomes quite simple, as I described above (ie. with a simple counter).
And as I said, the user would immediately spot the problem while editing
the text because the syntax coloring clearly shows that the comment is
ending somewhere he didn't expect.

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.